<template>
  <div>
    <h2>Shop</h2>
    <h2>root</h2>
    {{ $store.state.title }}
    <button @click="SET_TITLE('hahaha')">SET_TITLE</button>
    <hr>
    {{ $store.state.num }}
    <button @click="SET_NUM(10)">SET_TITLE</button>
    <h2>cart</h2>
    {{ $store.state.cart.title }}
    <button @click="SET_TITLE2('hahaha')">SET_TITLE</button>
    <hr>
    {{ $store.state.cart.num }}
    <button @click="SET_NUM2(10)">SET_TITLE</button>
    <h2>shop</h2>
    <h2>localShop</h2>
  </div>
</template>
<script>
import { mapMutations } from 'vuex';

const mm1 = mapMutations(['SET_TITLE', 'SET_NUM'])
const mm2 = mapMutations('cart', {
  SET_TITLE2: 'SET_TITLE',
  SET_NUM2: 'SET_NUM'
})
export default {
  methods: {
    ...mm1,
    ...mm2
  }
}
</script>